import styles from './index.less';
import { Input } from 'antd';
import { useState } from 'react';
export default props => {
  const [inputVisable, setInputVisable] = useState(false);
  return (
    <div
      onClick={() => {
        setInputVisable(true);
      }}
      className={styles.lableinputbox}
    >
      <div>{props.value}</div>
      {inputVisable ? (
        <div className={styles.handlerinput}>
          <Input
            autoFocus
            onBlur={event => {
              if (props.onFocusLeaves) {
                props.onFocusLeaves(event);
              }
              setInputVisable(false);
            }}
            defaultValue={props.value}
          ></Input>
        </div>
      ) : null}
    </div>
  );
};
